static void gtk_notebook_pages_allocate (GtkNotebook *notebook,
GtkNotebookDragOperation operation);
static void gtk_notebook_page_allocate (GtkNotebook *notebook,
- GtkNotebookPage *page,
- GtkAllocation *allocation);
+ GtkNotebookPage *page);
static void gtk_notebook_calc_tabs (GtkNotebook *notebook,
GList *start,
GList **end,
if (!notebook->cur_page)
return FALSE;
- priv->mouse_x = (gint) event->x;
- priv->mouse_y = (gint) event->y;
+ gdk_window_get_pointer (notebook->event_window,
+ &priv->mouse_x,
+ &priv->mouse_y,
+ NULL);
if (notebook->cur_page->detachable &&
check_threshold (notebook, priv->mouse_x, priv->mouse_y))
(notebook->cur_page->pack == GTK_PACK_END && left_x < anchor_x))
{
left_x = notebook->cur_page->allocation.x = anchor_x;
- gtk_notebook_page_allocate (notebook, notebook->cur_page,
- ¬ebook->cur_page->allocation);
-
anchor_x += notebook->cur_page->allocation.width - tab_overlap;
}
}
(notebook->cur_page->pack == GTK_PACK_END && right_x > anchor_x))
{
anchor_x -= notebook->cur_page->allocation.width;
-
left_x = notebook->cur_page->allocation.x = anchor_x;
- gtk_notebook_page_allocate (notebook, notebook->cur_page,
- ¬ebook->cur_page->allocation);
-
anchor_x += tab_overlap;
}
}
(notebook->cur_page->pack == GTK_PACK_END && top_y < anchor_y))
{
top_y = notebook->cur_page->allocation.y = anchor_y;
- gtk_notebook_page_allocate (notebook, notebook->cur_page,
- ¬ebook->cur_page->allocation);
-
anchor_y += notebook->cur_page->allocation.height - tab_overlap;
}
break;
}
- gtk_notebook_page_allocate (notebook, page, &child_allocation);
+ page->allocation = child_allocation;
switch (tab_pos)
{
anchor_x -= notebook->cur_page->allocation.width;
notebook->cur_page->allocation.x = anchor_x;
- gtk_notebook_page_allocate (notebook, notebook->cur_page,
- ¬ebook->cur_page->allocation);
}
break;
case GTK_POS_LEFT:
case GTK_POS_RIGHT:
if (PAGE_TOP_Y (notebook->cur_page) > anchor_y)
- {
- notebook->cur_page->allocation.y = anchor_y;
- gtk_notebook_page_allocate (notebook, notebook->cur_page,
- ¬ebook->cur_page->allocation);
- }
+ notebook->cur_page->allocation.y = anchor_y;
+
break;
}
}
break;
}
- gtk_notebook_page_allocate (notebook, page, &child_allocation);
+ page->allocation = child_allocation;
switch (tab_pos)
{
anchor_x -= notebook->cur_page->allocation.width;
notebook->cur_page->allocation.x = anchor_x;
- gtk_notebook_page_allocate (notebook, notebook->cur_page,
- ¬ebook->cur_page->allocation);
}
break;
case GTK_POS_LEFT:
{
anchor_y -= notebook->cur_page->allocation.height;
notebook->cur_page->allocation.y = anchor_y;
- gtk_notebook_page_allocate (notebook, notebook->cur_page,
- ¬ebook->cur_page->allocation);
}
break;
}
}
done:
+ children = notebook->children;
+
+ while (children)
+ {
+ page = children->data;
+ children = children->next;
+
+ if (GTK_WIDGET_DRAWABLE (page->tab_label))
+ gtk_notebook_page_allocate (notebook, page);
+ }
+
gtk_notebook_redraw_tabs (notebook);
}
static void
gtk_notebook_page_allocate (GtkNotebook *notebook,
- GtkNotebookPage *page,
- GtkAllocation *allocation)
+ GtkNotebookPage *page)
{
GtkWidget *widget = GTK_WIDGET (notebook);
GtkAllocation child_allocation;
xthickness = widget->style->xthickness;
ythickness = widget->style->ythickness;
- page->allocation = *allocation;
gtk_widget_get_child_requisition (page->tab_label, &tab_requisition);
if (notebook->cur_page != page)
* {
* GtkWidget *notebook;
* GtkWidget **child;
- *
+ *
* notebook = gtk_drag_get_source_widget (context);
* child = (void*) selection_data->data;
- *
+ *
* process_widget (*child);
* gtk_container_remove (GTK_CONTAINER (notebook), *child);
* }